﻿#include "pch.h"
#if defined(_WIN32) && !defined(_WIN64)
#define VLD_FORCE_ENABLE
#include <vld.h>
#endif

#pragma comment(lib, "gtest.lib")
#pragma comment(lib, "gtest_main.lib")
#pragma comment(lib, "BridgeAnalysis.lib")
#ifdef _WIN32________
#pragma comment(lib, "ChemDevLayerDLL.lib")
#endif
#pragma comment(lib, "ChemDLL.lib")

using namespace std::chrono_literals;
int32_t main(int32_t argc, char **argv)
{
    for (int i = 0; i < argc; ++i) {
        if (std::string(argv[i]) == "--version") {
            std::cout << "BridgeTest version: " << BRIDGE_TEST_VERSION << std::endl;
            return 0;
        }
    }
    
    std::string json_str = R"({"name": "John", "age": 30})";
    boost::json::value jv = boost::json::parse(json_str);
    boost::json::object obj = jv.as_object();
    std::string name = obj["name"].as_string().c_str();
    int32_t age = (int32_t)obj["age"].as_int64();
    STD_COUT << "Name: " << name << ", Age: " << age << STD_ENDL;
    ::testing::InitGoogleTest(&argc, argv);
    testDLL();
    for (int32_t i = 0; i < 1; i++)
    {
        int32_t test_result = RUN_ALL_TESTS();
        std::this_thread::sleep_for(5s);
        STD_COUT << "test_result: " << test_result << STD_ENDL;
    }
    return 0;
}
